<form>
<fieldset>
    <label for="OkoshkoVISA">VISA</label> <input type="text" name="OkoshkoVISA" onblur="alert(validateCardNumber('VISA', this.value));" /><br />
    <label for="OkoshkoMASTER">MASTER</label> <input type="text" name="OkoshkoMASTER" onblur="alert(validateCardNumber('MASTER', this.value));" /><br />
    <label for="OkoshkoAMEX">AMEX</label> <input type="text" name="OkoshkoAMEX" onblur="alert(validateCardNumber('AMEX', this.value));" /><br />
    <label for="OkoshkoDISCOVER">DISCOVER</label> <input type="text" name="OkoshkoDISCOVER" onblur="alert(validateCardNumber('DISCOVER', this.value));" /><br />
</fieldset>
</form>
<script type="text/javascript">
function validateCardNumber(type, number)
{
    type = "" + type;
    number = "" + number;

    var regexp = /^\d+$/;

    switch (type) {

    case 'VISA':
        return (/^4\d{12}(\d{3})?$/).test(number);

    case 'MASTER':
        return (/^5\d{15}$/).test(number);

    case 'AMEX':
        return (/^3(4|7)\d{13}$/).test(number);

    case 'DISCOVER':
        return (/^6011\d{12}$/).test(number);
    }

    return false;
}
</script>